<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>PANEO ARTICLES</title>
<%include file="_head.html"/>

<script src='/_paneo/common/js/jquery.autosize.js'></script>
<script type="text/javascript">
$(document).ready(
function()
{
$('.autosize').autosize();
}
);
</script>

</head>
<body>

<div class="navbar navbar-fixed-top">

<%include file="_header.html" />

</div>

<div class="container-fluid">

<div class="row-fluid">

<div class="span2">
<!--Sidebar content-->
    <%include file="_sidebar.html" />
</div>
<div class="span10">
    <div id="content">
    <div style="text-align:right;">
    <a href="/paneo/articles/${article.prefix}/trans/">TRANS</a>
    </div>
    <h1>
    ARTICLES
    %if mode == 'view':
    <a href="/paneo/articles/${article.prefix}/new/" class="btn" style="margin-left:30px;">新しい記事の追加</a>
    %else:
    <a href="/paneo/articles/${article.prefix}/" class="btn" style="margin-left:30px;">一覧に戻る</a>
    %endif
    </h1>
    <hr>

    <!-- ARTICLES LIST -->
    <%include file="articles_list.html"/>

    <hr>
    <form class="form-horizontal"  enctype="multipart/form-data" method="POST">
    <fieldset>

        <div class="control-group">
            <label class="control-label" for="ARTICLESNAME">ドキュメント名 [例:article.title]</label>
            <div class="controls">
            <input type="text" class="input-xlarge span2" id="ARTICLESNAME" name="ARTICLESNAME" readonly="readonly" value="${article.title}">
            <p class="help-block"></p>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="ARTICLESHEADER">段落ヘッダー文 [例:article.header]</label>
            <div class="controls">
            <input type="text" class="input-xlarge span9" name="HEADER" value="${article.header}">
            <p class="help-block"></p>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="ARTICLESLEAD">段落リード文 [例:article.lead]</label>
            <div class="controls">
            <textarea name="LEAD" class="autosize input-xlarge span9">${article.lead}</textarea>
            <p class="help-block"></p>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="ARTICLESDESCRIPTION">概要 (metaタグ)</label>
            <div class="controls">
            <input type="text" class="input-xlarge span9" id="DESCRIPTION" name="DESCRIPTION" value="${article.description}">
            <p class="help-block"></p>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="ARTICLESKEYWORD">キーワード (metaタグ)</label>
            <div class="controls">
            <input type="text" class="input-xlarge span9" id="KEYWORD" name="KEYWORD" value="${article.keyword}">
            <p class="help-block"></p>
            </div>
        </div>

        <hr>
        %for i in range(1,6):
        <div class="control-group">
        <label class="control-label">
        共有テキスト${i}<br>
        
        </label>
        <div class="controls">
        <textarea class="autosize" style="width:85%;" name="CONTEXT${i}">${article.context.get('context%s'%i)}</textarea>
        <p class="help-block"></p>
        </div>
        %endfor
        </div>
        <hr>

        <hr>

        %for i in range(1,4):
        <div class="control-group">
        <label class="control-label" for="simg${i}">
        ${article.title}<br>
        共有画像${i}
        <div>
        %if article_img[ 'art_%s_img%s_file' % (prefix,i) ][0] : 
        <img src="//${web.ctx.host}/${"%s/img/art_%s_img%s" % ( PANEO_SITE_DIR , prefix , i )}">
        %endif
        </div>
        name:art_${prefix}_img${i}
        </label>
        <div class="controls">
        <span class="label help-block">画像 FILE UPLOAD</span> 
        <input type="file" id="art_${prefix}_img${i}_file" name="art_${prefix}_img${i}_file" size="20"><br>
        <input type="checkbox" id="art_${prefix}_img${i}_file_del" name="art_${prefix}_img${i}_file_del" value="True">
        <span class="help-inline">
        アップロードした画像を削除する場合はチェックしてください。 
        </span>
        <span class="label help-block">画像代替えテキスト</span> 
        <input type="text" name="art_${prefix}_img${i}_alt" class="input-xlarge" style="width:98%;" 
                value="${img_alt.get('art_%s_img%s_alt'%(prefix,i),'')}" />
        %if article_img[ 'art_%s_img%s_file' % (prefix,i) ][0] : 
        <% t = '<div class="paneoimg"><img src="%s" alt="%s"></div>' % ( '$'+"{paneoimg('"+ article_img['art_%s_img%s_file' % (prefix,i) ][1].replace('/img/','') + "')}" , img_alt.get('art_%s_img%s_alt'%(prefix,i)) ) %> 
        <span class="label help-block">テンプレート画像タグ</span> 
        <pre>${ t| h }</pre>
        %endif
        </div>
        </div>
        <hr>
        %endfor

        <div class="form-actions">
            <button class="btn btn-primary" type="submit">更新する</button>
            <button class="btn" type="reset" style="margin-left:20px;">Cancel</button>
        </div>
    </fieldset>
    </form>
    </div><!--/div#content row span-->
</div>

</div><!--/row-->

</div><!--/container-fluid"-->

<hr>

<%include file="_footer.html" />

</div><!--/.fluid-container-->

</body>
</html>


